#!/sbin/openrc-run
supervisor=supervise-daemon

command="/usr/bin/node_exporter"
command_args="$ARGS"
command_background="yes"
group="prometheus"
user="prometheus"

logdir="/var/log/prometheus"
logfile="$logdir/${SVCNAME}.log"
pidfile="/var/run/${SVCNAME}.pid"
start_stop_daemon_args="--stderr $logfile --user $user --group $group"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -d -o $user:$group -m755 $logdir
	checkpath -f -o $user:$group -m644 $logfile
}
